import request from '@/utils/request'

const baseURL = '/LoginAndSign'

// 登录
export const loginCount = (countInfoLogin) => {
  return request.get(baseURL, {
    params: {
      username: countInfoLogin.username,
      password: countInfoLogin.password
    }
  })
}

// 注册
export const signCount = (countInfo) => {
  return request.post(baseURL, {
    id: '',
    username: countInfo.username,
    password: countInfo.password
  })
}

// 保存用户信息
export const saveUserInfo = (resCount, countInfo) => {
  return request.post(`${baseURL}/save`, {
    id: resCount.data, //uuid
    name: countInfo.name,
    username: countInfo.username,
    email: countInfo.email,
    gender: countInfo.gender,
    birthday: countInfo.birthday,
    phone: countInfo.phone,
    address: countInfo.address,
    money: countInfo.money
  })
}
